package com.aiyige.page.edituserinfo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.aiyige.MyApp;
import com.aiyige.R;
import com.aiyige.page.edituserinfo.EditUserAddressSubChinaPage;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by zhuyakun on 2017/11/1.
 */

public class EditUserAddressPagerAdapter extends FragmentPagerAdapter {
    List<Fragment> fragmentList = new LinkedList<>();
    String[] pageTitleArray;

    public EditUserAddressPagerAdapter(FragmentManager fm) {
        super(fm);
        pageTitleArray = MyApp.getAppContext().getResources().getStringArray(R.array.SelectRegionPageTitle);
        fragmentList.add(EditUserAddressSubChinaPage.newInstance());
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return pageTitleArray[position];
    }
}
